using UnityEngine;
using System.Collections;

[RequireComponent (typeof(BoxCollider))]
[AddComponentMenu("Third Person Props/Jump pad")]

public class Jumppad : MonoBehaviour
{
	public float jumpHeight = 5.0f;
	
	void OnTriggerEnter(Collider col)
	{
		ThirdPersonController controller = col.GetComponent<ThirdPersonController>();
		if(controller != null)
		{
			if(audio)
			{
				audio.Play();
			}
			
			controller.SuperJump(jumpHeight);
		}
	}
	
	void Reset()
	{
		if(collider == null)
		{
			gameObject.AddComponent<BoxCollider>();
		}
		
		collider.isTrigger = true;
	}
}